import 'package:flutter/material.dart';
import 'package:get/get_navigation/src/routes/get_route.dart';
import 'package:part_time_job_pro/common/middlewares/router_spash.dart';
import 'package:part_time_job_pro/common/routers/names.dart';
import 'package:part_time_job_pro/common/routers/observers.dart';
import 'package:part_time_job_pro/pages/agreement/bindings.dart';
import 'package:part_time_job_pro/pages/agreement/view.dart';
import 'package:part_time_job_pro/pages/find/bindings.dart';
import 'package:part_time_job_pro/pages/find/view.dart';
import 'package:part_time_job_pro/pages/forget/bindings.dart';
import 'package:part_time_job_pro/pages/forget/view.dart';
import 'package:part_time_job_pro/pages/home/index.dart';
import 'package:part_time_job_pro/pages/login/index.dart';
import 'package:part_time_job_pro/pages/message/bindings.dart';
import 'package:part_time_job_pro/pages/message/view.dart';
import 'package:part_time_job_pro/pages/offer/bindings.dart';
import 'package:part_time_job_pro/pages/offer/full_offer_list/bindings.dart';
import 'package:part_time_job_pro/pages/offer/full_offer_list/view.dart';
import 'package:part_time_job_pro/pages/offer/part_offer_list/bindings.dart';
import 'package:part_time_job_pro/pages/offer/part_offer_list/view.dart';
import 'package:part_time_job_pro/pages/offer/proxy/bindings.dart';
import 'package:part_time_job_pro/pages/offer/proxy/view.dart';
import 'package:part_time_job_pro/pages/offer/school_offer_list/bindings.dart';
import 'package:part_time_job_pro/pages/offer/school_offer_list/view.dart';
import 'package:part_time_job_pro/pages/offer/view.dart';
import 'package:part_time_job_pro/pages/public/full/bindings.dart';
import 'package:part_time_job_pro/pages/public/full/view.dart';
import 'package:part_time_job_pro/pages/public/part/bindings.dart';
import 'package:part_time_job_pro/pages/public/part/detail/bindings.dart';
import 'package:part_time_job_pro/pages/public/part/detail/view.dart';
import 'package:part_time_job_pro/pages/public/part/view.dart';
import 'package:part_time_job_pro/pages/public/school/bindings.dart';
import 'package:part_time_job_pro/pages/public/school/view.dart';
import 'package:part_time_job_pro/pages/register/index.dart';
import 'package:part_time_job_pro/pages/service/bindings.dart';
import 'package:part_time_job_pro/pages/service/lang_setting/bindings.dart';
import 'package:part_time_job_pro/pages/service/lang_setting/view.dart';
import 'package:part_time_job_pro/pages/service/theme_setting/bindings.dart';
import 'package:part_time_job_pro/pages/service/theme_setting/view.dart';
import 'package:part_time_job_pro/pages/service/view.dart';
import 'package:part_time_job_pro/pages/splash/index.dart';
import 'package:part_time_job_pro/pages/sqlite/index.dart';
import 'package:part_time_job_pro/pages/sqlite/view.dart';

///路由配置
class AppPages {
  ///初始路由
  static const initRoute = LoginPage.routeName;

  ///路由观察
  static final RouteObserver<Route> observer = RouteObservers();

  ///路由历史
  static List<String> history = [];

  static final List<GetPage> routes = [
    // 免登陆
    GetPage(
      name: AppRoutes.initRoute,
      page: () => const SplashPage(),
      binding: SplashBinding(),
      middlewares: [
        RouteSplashMiddleware(priority: 1),
      ],
    ),
    GetPage(
      name: AppRoutes.userLogin,
      page: () => LoginPage(),
      binding: LoginBinding(),
    ),
    GetPage(
      name: AppRoutes.userRegister,
      page: () => RegisterPage(),
      binding: RegisterBinding(),
    ),

    ///忘记密码界面
    GetPage(
      name: ForgetPage.routeName,
      page: () => ForgetPage(),
      binding: ForgetBinding(),
    ),

    ///协议页面
    GetPage(
      name: AppRoutes.agreement,
      page: () => AgreementPage(),
      binding: AgreementBinding(),
    ),

    ///主页面
    GetPage(
      name: AppRoutes.homePage,
      page: () => HomePage(),
      binding: HomeBinding(),
    ),

    ///发布兼职页面
    GetPage(
      name: AppRoutes.publicPartJob,
      page: () => PartJobPage(),
      binding: PartJobBinding(),
    ),

    ///兼职完善详情页面
    GetPage(
      name: AppRoutes.publicPartJobDetail,
      page: () => const PartDetailPage(),
      binding: PartDetailBinding(),
    ),

    ///发布全职页面
    GetPage(
      name: AppRoutes.publicFullJob,
      page: () => FullJobPage(),
      binding: FullJobBinding(),
    ),

    ///发布校招页面
    GetPage(
      name: AppRoutes.publicSchoolJob,
      page: () => SchoolJobPage(),
      binding: SchoolJobBinding(),
    ),

    ///招聘页面
    GetPage(
      name: OfferPage.routeName,
      page: () => OfferPage(),
      binding: OfferBinding(),
    ),

    ///全职列表页面
    GetPage(
      name: FullOfferListPage.routeName,
      page: () => FullOfferListPage(),
      binding: FullOfferListBinding(),
    ),

    ///兼职列表页面
    GetPage(
      name: PartOfferListPage.routeName,
      page: () => PartOfferListPage(),
      binding: PartOfferListBinding(),
    ),

    ///校招列表页面
    GetPage(
      name: SchoolOfferListPage.routeName,
      page: () => SchoolOfferListPage(),
      binding: SchoolOfferListBinding(),
    ),

    ///代招页面
    GetPage(
      name: ProxyPage.routeName,
      page: () => ProxyPage(),
      binding: ProxyBinding(),
    ),

    ///招人页面
    GetPage(
      name: FindPage.routeName,
      page: () => FindPage(),
      binding: FindBinding(),
    ),

    ///消息页面
    GetPage(
      name: MessagePage.routeName,
      page: () => MessagePage(),
      binding: MessageBinding(),
    ),

    ///服务页面
    GetPage(
      name: ServicePage.routeName,
      page: () => ServicePage(),
      binding: ServiceBinding(),
    ),

    ///语言设置
    GetPage(
      name: LangSettingPage.routeName,
      page: () => LangSettingPage(),
      binding: LangSettingBinding(),
    ),

    ///主题设置
    GetPage(
      name: ThemeSettingPage.routeName,
      page: () => ThemeSettingPage(),
      binding: ThemeSettingBinding(),
    ),

    ///db页面
    GetPage(
      name: SqlitePage.routeName,
      page: () => SqlitePage(),
      binding: SqliteBinding(),
    )
  ];
}
